<template>
	<div>
		<button @click="isShow = !isShow">隐藏/显示</button>
		<transition name="a1">
			<h1 v-show="isShow">你好啊！</h1>
		</transition>
		<transition name="a2">
			<h1 v-show="isShow">欢迎学习前端！</h1>
		</transition>
	</div>
</template>

<script>
	export default {
		name:'App',
		data() {
			return {
				isShow:true
			}
		},
	}
</script>

<style>
	h1{
		background-color: orange;
	}
	@keyframes atguigu{
		0%{
			transform: translateX(0px);
		}
		100%{
			transform: translateX(-100%);
		}
	}
	.a1-leave-active{
		animation: atguigu 3s linear;
	}
	.a1-enter-active{
		animation: atguigu 3s linear reverse;
	}

	.a2-leave-active{
		animation: atguigu 1s linear;
	}
	.a2-enter-active{
		animation: atguigu 1s linear reverse;
	}
</style>